// 深度遍历部门列表
export const dfsDept = (item, staffs) => {
  const tempStaffs = staffs;
  if (!item.children) return;
  item.children.forEach(child => {
    if (!child.isDepartment) {
      const { userId, userName, avatar, post, number } = child;
      const param = {
        id: userId,
        userName,
        avatar,
        post,
        number
      };
      tempStaffs.push(param);
    }
    dfsDept(child, tempStaffs);
  });
  return tempStaffs;
};
